define(function(require, exports, module){
	
	/**
     * @name popPosition
     * @class 封装广告位预览。
     */
	var initPosition = function(option){
		var op = $.extend({
			width: '',
			height: '',
			num: 1,
			showtype: 0,
			time: 3000,
			arraytype: 0,
			customtmpl: '',
			key: 'material="true"',
			modal: true
		},option);
		
		if(semi.utils.isEmpty(op.width) || semi.utils.isEmpty(op.width)){
			return;
		}
		
		var positionDlg = top.$dialog({
			title: '广告位预览',
			url: '/static/trp/template/popposition.html?width='+op.width+'&height='+op.height+'&num='+op.num+'&showtype='+op.showtype+'&time='+op.time+'&arraytype='+op.arraytype+'&customtmpl='+encodeURIComponent(op.customtmpl)+'&key='+encodeURIComponent(op.key),
			width: op.width,
			height: op.height,
			cancelValue: '关闭',
			cancel: true
		});
		
		if(op.modal){
			positionDlg.showModal();
		}else{
			positionDlg.show();
		}
	}
	
	return {
		show: initPosition
	}
});